﻿@model kxcxw.Data.Entities.AdApply
@{
    ViewBag.Title = "申请广告位";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div class="page_content">
<div class="registercontent">
    <h2>
        填写广告信息</h2>
    @Html.Partial("_StepCtrlForAd", 3)
    @using (Html.BeginForm("Apply", "Ad", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {
        <fieldset style="border: 0px;">
            @Html.HiddenFor(model => model.AdId)
            @Html.HiddenFor(model => model.CreateDate)
            @Html.HiddenFor(model => model.EffectiveDays)
            @Html.HiddenFor(model => model.Status)
            <div class="field" style="height: 30px">@Html.ValidationSummary(true, "填写有误!请更正错误，重试!")</div>
            <div class="field">
                <div class="editor-label">
                    广告位置：
                </div>
                <div class="editor-field">
                    @ViewBag.BlockDesc
                </div>
            </div>
            <div class="field">
                <div class="editor-label">
                    区域中位置：
                </div>
                <div class="editor-field">
                    @Html.DropDownList("AdBlockId", (IEnumerable<SelectListItem>)ViewBag.AdBlockList)
                    @Html.ValidationMessageFor(m => m.AdBlockId)
                </div>
                <label>
                    选择广告显示在所选区域的具体位置
                </label>
            </div>
            <div class="field">
                <div class="editor-label">
                    有效期：
                </div>
                <div class="editor-field">
                    @Html.DisplayFor(model => model.EffectiveDays) 天 (从审核通过之日起算)
                </div>
            </div>
            <div class="field">
                <div class="editor-label">
                    图片：
                </div>
                <div class="editor-field">
                    <input type="file" name="ImgName" id="ImgName" />
                    @Html.ValidationMessageFor(m => m.ImgName)
                </div>
                <label>
                    显示到广告位的图片， <span style="color:Red">规格：@(ViewBag.width)px * @(ViewBag.height)px</span>
                </label>
            </div>
            <div class="field">
                <div class="editor-label">
                    文本描述：
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.AltText)
                    @Html.ValidationMessageFor(m => m.AltText)
                </div>
                <label>
                    鼠标悬浮时的文本。
                </label>
            </div>
            <div class="field">
                <div class="editor-label">
                    链接地址：
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.Href)
                    @Html.ValidationMessageFor(m => m.Href)
                </div>
                <label>
                    图片广告对应的链接地址，如：http://www.kxcxw.com
                </label>
            </div>
            @if (string.IsNullOrEmpty(Model.UserID))
            {
                <div class="field">
                    <div class="editor-label">
                        联系人：
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(m => m.ApplyerName)
                        @Html.ValidationMessageFor(m => m.ApplyerName)
                    </div>
                </div>
                <div class="field">
                    <div class="editor-label">
                        联系电话：
                    </div>
                    <div class="editor-field">
                        @Html.TextBoxFor(m => m.Phone)
                        @Html.ValidationMessageFor(m => m.Phone)
                    </div>
                    <label>
                        用于核对信息时的联系电话，申请后请保持联系畅通。
                    </label>
                </div>
            }
            else
            {
                <div class="field">
                    <div class="editor-label">
                        申请人：
                    </div>
                    <div class="editor-field">
                        @Html.DisplayFor(m => m.ApplyerName)
                        @Html.HiddenFor(m => m.ApplyerName)
                        @Html.HiddenFor(m => m.UserID)
                        @Html.Hidden("Phone","-")
                    </div>
                </div>
            }
            <div style="float: left; margin-left: 77px; display: inline;">
                <input class="btn_mid" type="submit" value="提交申请" />
            </div>
        </fieldset>
    }
</div>
</div>
